<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>网站后台管理中心- Powered by UUASK</title>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="/<?php echo C('UU_ADMINTPL_DIR');?>/public/css/common.css" rel="stylesheet" type="text/css">
<script src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/jquery.min.js"></script>
<script src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/jquery.highlight-3.js"></script>
<script src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/jquery.vtip-min.js"></script>
<script src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/jquery.dialog.js"></script>
<!--[if lt IE 9]>
  <script type="text/javascript" src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/PIE.js"></script>
  <script type="text/javascript">
    (function($){
        $.pie = function(name, v){
            // 如果没有加载 PIE 则直接终止
            if (! PIE) return false;
            // 是否 jQuery 对象或者选择器名称
            var obj = typeof name == 'object' ? name : $(name);
            // 指定运行插件的 IE 浏览器版本
            var version = 9;
            // 未指定则默认使用 ie10 以下全兼容模式
            if (typeof v != 'number' && v < 9) {
                version = v;
            }
            // 可对指定的多个 jQuery 对象进行样式兼容
            if ($.browser.msie && obj.size() > 0) {
                if ($.browser.version*1 <= version*1) {
                    obj.each(function(){
                        PIE.attach(this);
                    });
                }
            }
        }
    })(jQuery);
    if ($.browser.msie) {
      $.pie('.pie_about');
    };
  </script>
<![endif]-->
<script src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/jquery.disappear.tooltip.js"></script>
<script src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/common.js"></script>
</head>
<body>
<div class="allpagetop">网站配置<strong>/</strong>文章分类<strong>/</strong>添加</div>
<div class="admin_main_nr_dbox">
<div class="pagetit">
	        <div class="ptit">文章分类</div>
				<div class="topnav">
			        <a href="<?php echo RU('Category/cat_article',array('c_type'=>$c_type));?>" <?php if(ACTION_NAME == 'cat_article'): ?>class="select"<?php endif; ?>>列表</a>
					   <a href="<?php echo RU('Category/cat_article_add',array('c_type'=>$c_type));?>" <?php if(ACTION_NAME == 'cat_article_add'): ?>class="select"<?php endif; ?>>添加</a>
				    <div class="clear"></div>
				</div>
	        <div class="clear"></div>
  </div>
		
		
    <div class="toptit">添加文章分类</div>
  <form action="<?php echo RU('Category/cat_article_add');?>" method="post"   name="FormData" id="FormData" >
  <input name="url" type="hidden" value="<?php echo RU('Category/cat_article',array('c_type'=>$c_type));?>" />
  <input name="c_type" type="hidden" value="<?php echo ($c_type); ?>" />
  <input name="c_pid" type="hidden"  id="c_pid" value="<?php echo ((isset($c_pid) && ($c_pid !== ""))?($c_pid):'0'); ?>" />
	  <div class="admin_form_main">
	  
	    <div class="fl">分类名称:</div>
		<div class="fr"><input name="c_title" type="text"  class="input_text_default" maxlength="60" placeholder="请输入分类名称"/></div>
		<div class="fl">分类排序:</div>
		<div class="fr">
		<input name="c_sort" type="text"  class="input_text_default"  maxlength="8" onkeyup="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"   placeholder="数字越大越靠前，默认是0"/>
		</div>
		<div class="fl">所属分类:</div>
			<div class="fr"><input name="c_pid_cn" id="c_pid_cn" type="text"  class="input_text_default J_cat_show" maxlength="60" placeholder="请选择所属分类" readonly="readonly" value="<?php echo ($c_pid_cn); ?>"/></div>

		 
		<div class="fl">上传图标:</div>
		 <div class="fr" id="up_img_show">
		 <input name="c_pic" type="hidden" value="" />
		 
	 		 
			   
		   		<div class="input_up_btn" id="input_up_btn" name="category_img" title="上传图片"></div>
			 	<div class="clear"></div>
				
				
		</div>
		
		 <div class="fl"></div>
		<div class="fr">
		<input name="" type="submit" class="admin_submit big"    value="保存分类"/>
		</div>
		
		
		
		<div class="clear"></div>
		
	  </div>
  
  
      <div id="J_cat_from"></div>
	  
  </form>
</div>
 
<div id="J_cat_select" style="display:none">

	  <div class="showdialog">
		<div class="dtit">请选择分类</div>
		  <div class="dlistx" id="0" >顶级分类</div>
		  <?php if(is_array($catlist)): $i = 0; $__LIST__ = $catlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$catlist): $mod = ($i % 2 );++$i;?><div class="dlistx" id="<?php echo ($catlist["c_id"]); ?>"><?php echo ($catlist["c_title"]); ?></div><?php endforeach; endif; else: echo "" ;endif; ?>
		<div class="clear"></div>
	  </div>
	  
</div>


<div class="footer link_lan">
Powered by <a href="http://www.zgxmall.com" target="_blank"><span style="color:#009900">中港星企业服务</span><span style="color: #FF3300">论坛</span></a> <?php echo C('UU_VERSION');?>
</div>
</body>
</html>
<script type="text/javascript">
	var uploadUrl = "/index.php?m=home&c=Upload&a=img";
</script>
<script src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/ajaxfileupload.js"></script>
<script src="/<?php echo C('UU_ADMINTPL_DIR');?>/public/js/fileupload.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
 $(".J_cat_show").dialog({
  DialogAddObj:"#J_cat_from",
  DialogTitle:"请选择所属分类",
  DialogContent:"#J_cat_select",
  DialogContentType:"id"
  });
    
$('#J_cat_from .dlistx').live('click',function() {
  $("#c_pid_cn").val($(this).html());
  $("#c_pid").val($(this).attr('id'));
  $(" .FloatBg").remove();
  $(" .FloatBox").remove();
});
	// 上传图标
$.upload('#input_up_btn',{type:'category_img'},function(result){
		html="";
		html+="<div class=\"input_up_img\">";
		html+="<a href=\"/<?php echo C('UU_IMG_CATEGORY_DIR');?>5896b962c92cc.jpg\" target=\"_blank\"><img src=\"/<?php echo C('UU_IMG_CATEGORY_DIR');?>5896b962c92cc.jpg\" border=\"0\" /></a>";
		html+="<div class=\"del\" id=\"J_del\">删除</div>";
		html+="</div>";
		
		if(result.status == 1){
			//disapperTooltip("success", "图片上传成功!");
			$("#up_img_show").prepend(html);
			$(".input_up_img").find('a').attr('href',result.content.src);
			$(".input_up_img").find('img').attr('src',result.content.src);
			$(".input_up_btn").hide();			
			$("input[name=c_pic]").val(result.content.savename);
			//$('#J_imgWrap').addClass('select').find('img').attr('src',result.data.url);
			//$('input[name="certificate_img_up"]').val(result.data.img);
			//$('#certificate_img_up').closest('.J_validate_group').find('.J_showtip_box').removeClass('pl0').html('<div class="ok"></div>');
		} else {
			disapperTooltip("remind", "上传失败："+result.content);
			// disapperTooltip("success", "上传成功");
			// alert("上传失败："+result.content);
		}
	});
	//删除上传图片
	$('#J_del').live('click',function() {
	 	$(".input_up_btn").show();
		$(".input_up_img").hide();
		$("input[name=c_pic]").val('');
	});

});
</script>
</body>
</html>